package cn.dgut.training.controller;

import cn.dgut.training.entity.activity.Coupon;
import cn.dgut.training.entity.activity.CouponUser;
import cn.dgut.training.entity.activity.GroupBuying;
import cn.dgut.training.entity.goods.Goods;
import cn.dgut.training.vo.CommonResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@FeignClient(value = "shop-activity")
public interface ActivityService {

    @GetMapping("/health")
    public String health();

    @PostMapping("/coupon/create")
    public CommonResponse add(@RequestBody Coupon coupon);

    @GetMapping("/coupon/two")
    public List getTwo();

    @PostMapping("/coupon/ordersUse")
    Coupon orderUse(@RequestParam("userId") Long userId,@RequestParam("couponId")Long couponId);

    @PostMapping("/coupon/getUserCoupon")
    CouponUser getUserCoupon(@RequestParam("couponUserId") Long couponUserId);

    @GetMapping("/coupon/useUserCoupon")
    void useUserCoupon(@RequestParam("couponId") Long  couponId,@RequestParam("orderId") Long  orderId);

    @PostMapping("/coupon/listAllByUser")
    List<CouponUser> listAllByUser(@RequestParam("userId") Long userId);

    @PostMapping("/coupon/accordWith")
    Coupon accordWith(@RequestParam("couponId") Long couponId,@RequestParam("price") BigDecimal price);


    //轮播图

    @GetMapping("/ad/front/list")
    List frontListCarousel();


    @GetMapping("/group-buying/iGetById")
    GroupBuying iGetById(@RequestParam("grouponLinkId") Long grouponLinkId);

    @PostMapping("/group-buying/update")
    Integer iUpdateActivity(@RequestParam("id") Long id);

}
